% Demonstrate drawing and resizing of text objects.
clear
clear classes
clc

% access the manager that deals with drawing
dm = dotsTheDrawablesManager.theObject;

% create a text object with an arbitrady string to display
tx = dm.newObject('dotsDrawableText');
tx.string = 'Juniper juice';

% add the text object to an arbitrary group, for the manager to draw
dm.addObjectToGroup(tx, 'text');
dm.activateGroup('text');

% draw the text object with its string
dm.openScreenWindow;
dm.mayDrawNextFrame;
WaitSecs(1);

% draw the text object with a new string
tx.string = 'helicopter helicopter helicopter helicopter';
dm.mayDrawNextFrame;
WaitSecs(1);

% resize the text and draw it again
dm.setScreenTextSetting('TextSize', 24);
dm.mayDrawNextFrame;
WaitSecs(1);

% close the Psychtoolbox Screen window
dm.closeScreenWindow;